
package com.ido.babyshow.model;

import java.io.Serializable;
import java.util.Comparator;

/**
 * 栏目类
 * @author luo sq
 *
 */
public class Catalog implements Serializable
{
    /**
     * 
     */
    private static final long serialVersionUID = 2348860759631613863L;

    private int id;

    private String name;

    private String comments;

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getComments()
    {
        return comments;
    }

    public void setComments(String comments)
    {
        this.comments = comments;
    }

    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + id;
        return result;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        Catalog other = (Catalog)obj;
        if (id != other.id) return false;
        return true;
    }

    public static class CataComparetor implements Comparator<Catalog>
    {

        @Override
        public int compare(Catalog o1, Catalog o2)
        {
            if (o1.getId() > o2.getId())
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }

    }
    

}
